def make_chocolate(small, big, goal):
  if min(goal//5,big) >= big:
    if goal - big*5 < small:
      return goal % 5
  else:
    if min(goal//5,big) <= big:
      return goal//5